SpatialInterpolation Module

History

current version 1.5 - 18th December 2018

version date comment
1.0 03/Jun/2011 Original code
1.1 01/apr/2013 added Barnes Objective Analysis interpolation
1.2 20/Feb/2016 added Kriging interpolation
1.3 09/Mar/2016 WindMicromet added
1.4 01/Mar/2018 WindGonzalezLongatt added
1.5 18/Dec/2018 Kriging was moved to a specific module

License

license: GNU GPL http://www.gnu.org/licenses/

Module Description

set of generic routines to convert sparse point measurements to regular grid
Methods implemented:

  • Inverse Distance Weighted
  • Nearest Neighbor (Thiessen polygons)
  • Barnes Objective Analysis
  • Kriging with automatic fitting of linear semivariogram (moved to a specific module with several semivariogram models)
  • Wind with topographic correction Micromet
  • Wind with orographic correction (Gonzales-Longatt etal., 2015)

References:

González-Longatt, F., Medina, H., Serrano González, J., Spatial interpolation and orographic correction to estimate wind energy resource in Venezuela. Renewable and Sustainable Energy Reviews, 48, 1-16, 2015.



Subroutines

public subroutine BarnesOI(network, grid, gammapar)

The method constructs a grid of size determined by the distribution of the two dimensional data points. Using this grid, the function values are calculated at each grid point. To do this the method utilises a series of Gaussian functions, given a distance weighting in order to determine the relative importance of any given measurement on the determination of the function values. Correction passes are then made to optimise the function values, by accounting for the spectral response of the interpolated points.

Read more…

Arguments

Type IntentOptional Attributes Name
type(ObservationalNetwork), intent(in) :: network
type(grid_real), intent(inout) :: grid
real(kind=float), intent(in), optional :: gammapar

public subroutine IDW(network, grid, method, power, near)

Inverse Distance Weighted interpolation. Accept as optional argument the power parameter and the number of near observations to included in interpolation. Can use Shepard's method (Shepard 1968) or Franke & Nielson, 1980

Read more…

Arguments

Type IntentOptional Attributes Name
type(ObservationalNetwork), intent(in) :: network
type(grid_real), intent(inout) :: grid
integer(kind=short), intent(in) :: method
real(kind=float), intent(in), optional :: power
integer(kind=short), intent(in), optional :: near

public subroutine NearestNeighbor(network, grid, weights, gridPolygons)

The nearest neighbor algorithm selects the value of the nearest point and does not consider the values of neighboring points at all, yielding a piecewise-constant interpolant

Read more…

Arguments

Type IntentOptional Attributes Name
type(ObservationalNetwork), intent(in) :: network
type(grid_real), intent(inout) :: grid
real, intent(out), optional, POINTER :: weights(:)
type(grid_integer), intent(out), optional :: gridPolygons

public subroutine WindGonzalezLongatt(speed, dir, dem, grid, winddir)

This subroutine implements the method presented by Gonzalez-Longatt et al. (2015). Zonal and meridional components are computed and then orographic correction is applied. The two components are then re-composed to provide final result.

Read more…

Arguments

Type IntentOptional Attributes Name
type(ObservationalNetwork), intent(in) :: speed
type(ObservationalNetwork), intent(in) :: dir
type(grid_real), intent(in) :: dem
type(grid_real), intent(inout) :: grid
type(grid_real), intent(inout), optional :: winddir

public subroutine WindMicromet(speed, dir, slope, curvature, slope_az, slopewt, curvewt, grid, winddir)

This subroutine implements the method used in the MICROMET program (see reference). Wind speed is interpolated accounting for wind direction and an empirical weigth that considers slope and curvature (topographic effect)

Read more…

Arguments

Type IntentOptional Attributes Name
type(ObservationalNetwork), intent(in) :: speed
type(ObservationalNetwork), intent(in) :: dir
type(grid_real), intent(in) :: slope
type(grid_real), intent(in) :: curvature
type(grid_real), intent(in) :: slope_az
real(kind=float), intent(in) :: slopewt
real(kind=float), intent(in) :: curvewt
type(grid_real), intent(inout) :: grid
type(grid_real), intent(inout), optional :: winddir

private subroutine Sort(distance, ind_vec, nest, dist_sort, ind_vec_sort)

Sort distances in increasing order

Read more…

Arguments

Type IntentOptional Attributes Name
double precision, intent(in), DIMENSION(nest) :: distance
integer, intent(in), DIMENSION(nest) :: ind_vec
integer, intent(in) :: nest
double precision, intent(out), DIMENSION(nest) :: dist_sort
integer, intent(out), DIMENSION(nest) :: ind_vec_sort

private subroutine inverse(gamma, nest, inv_gamma)

Inverse matrix Method: Based on Doolittle LU factorization for Ax=b

Read more…

Arguments

Type IntentOptional Attributes Name
double precision, intent(in), DIMENSION(nest,nest) :: gamma
integer, intent(in) :: nest
double precision, intent(out), DIMENSION(nest,nest) :: inv_gamma